package yzserver.sx4a.dao.ibatis;

import com.sitech.ibnms.core.BaseIbnmsDao;
import yzserver.sx4a.dao.IRoleDao;
import yzserver.sx4a.domain.RoleDomain;

import java.util.HashMap;
import java.util.List;

public class RoleDaoImpl extends BaseIbnmsDao implements IRoleDao {


    @Override
    public RoleDomain selRole(String roleid) {
        HashMap map = new HashMap();
        map.put("roleid",roleid);
        return (RoleDomain)querySingle("shanxi_selRole",map);
    }

    @Override
    public void addRole(RoleDomain role) throws Exception {
        insert("shanxi_addRole",role);
    }

    @Override
    public void editRole(RoleDomain role) throws Exception {
        update("shanxi_editRole",role);
    }

    @Override
    public void delRole(String roleid) throws Exception {
        HashMap map = new HashMap();
        map.put("roleid",roleid);
        delete("shanxi_delRole",map);
    }

    @Override
    public List<RoleDomain> selAllRole(String roleid) {
        HashMap map = new HashMap();
        map.put("roleid",roleid);
        return (List<RoleDomain>)query("shanxi_selAllRole", map);
    }
}
